package com.samoiloff.ui.btns {
	import flash.display.MovieClip;
	import flash.text.TextField;

	/**
	 * @author Alexander Slavshik <as.kvint@gmail.com>
	 * created 01.03.2010
	 */
	public class TextBtnController extends BtnController {
		
		private var _tf:TextField;
		private var _label:String;
		
		public function TextBtnController(mc:MovieClip, label:String = "Label") {
			super(mc);
			_tf = mc.tf ? mc.tf : mc.caption;
//			Fonts.getInstance().applyDefaultFont(_tf);
			this.label = label;
		}

		
		override public function destroy(): void {
			_tf = null;
			super.destroy();
		}

		public function get label():String {
			return _tf.text;
		}
		
		public function set label(text:String):void {
			_label = text;
			_tf.text = text;
		}
	}
}
